home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10205 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  2.6 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 0a | 50 61 74 68 3a 20 68 61 |.lang.c.|Path: ha|
|00000020| 77 6b 65 79 65 2e 69 64 | 78 2e 63 6f 6d 21 73 6a |wkeye.id|x.com!sj|
|00000030| 6a 6d 0a 46 72 6f 6d 3a | 20 53 74 65 76 65 20 4d |jm.From:| Steve M|
|00000040| 6f 75 6e 74 20 3c 73 6a | 6a 6d 40 68 61 77 6b 65 |ount <sj|jm@hawke|
|00000050| 79 65 2e 69 64 78 2e 63 | 6f 6d 3e 0a 53 75 62 6a |ye.idx.c|om>.Subj|
|00000060| 65 63 74 3a 20 52 65 3a | 20 45 6d 70 74 79 20 53 |ect: Re:| Empty S|
|00000070| 74 72 69 6e 67 20 66 75 | 6e 63 74 69 6f 6e 0a 49 |tring fu|nction.I|
|00000080| 6e 2d 52 65 70 6c 79 2d | 54 6f 3a 20 3c 6d 30 74 |n-Reply-|To: <m0t|
|00000090| 78 63 43 36 2d 30 30 30 | 31 6c 43 43 40 68 61 6d |xcC6-000|1lCC@ham|
|000000a0| 6d 79 2e 6c 6f 6e 65 73 | 74 61 72 2e 6f 72 67 3e |my.lones|tar.org>|
|000000b0| 0a 43 6f 6e 74 65 6e 74 | 2d 54 79 70 65 3a 20 54 |.Content|-Type: T|
|000000c0| 45 58 54 2f 50 4c 41 49 | 4e 3b 20 63 68 61 72 73 |EXT/PLAI|N; chars|
|000000d0| 65 74 3d 55 53 2d 41 53 | 43 49 49 0a 4d 65 73 73 |et=US-AS|CII.Mess|
|000000e0| 61 67 65 2d 49 44 3a 20 | 3c 50 69 6e 65 2e 41 33 |age-ID: |<Pine.A3|
|000000f0| 32 2e 33 2e 39 31 2e 39 | 36 30 33 31 35 31 33 34 |2.3.91.9|60315134|
|00000100| 36 32 34 2e 31 37 34 37 | 35 36 42 2d 31 30 30 30 |624.1747|56B-1000|
|00000110| 30 30 2d 31 30 30 30 30 | 30 2d 31 30 30 30 30 30 |00-10000|0-100000|
|00000120| 40 68 61 77 6b 65 79 65 | 2e 69 64 78 2e 63 6f 6d |@hawkeye|.idx.com|
|00000130| 3e 0a 53 65 6e 64 65 72 | 3a 20 6e 65 77 73 40 76 |>.Sender|: news@v|
|00000140| 74 66 2e 69 64 78 2e 63 | 6f 6d 20 28 55 53 45 4e |tf.idx.c|om (USEN|
|00000150| 45 54 20 4e 65 77 73 20 | 53 79 73 74 65 6d 29 0a |ET News |System).|
|00000160| 4f 72 67 61 6e 69 7a 61 | 74 69 6f 6e 3a 20 49 44 |Organiza|tion: ID|
|00000170| 58 20 53 79 73 74 65 6d | 73 20 43 6f 72 70 6f 72 |X System|s Corpor|
|00000180| 61 74 69 6f 6e 0a 4d 69 | 6d 65 2d 56 65 72 73 69 |ation.Mi|me-Versi|
|00000190| 6f 6e 3a 20 31 2e 30 0a | 44 61 74 65 3a 20 46 72 |on: 1.0.|Date: Fr|
|000001a0| 69 2c 20 31 35 20 4d 61 | 72 20 31 39 39 36 20 31 |i, 15 Ma|r 1996 1|
|000001b0| 33 3a 35 31 3a 35 39 20 | 2d 30 35 30 30 0a 0a 4f |3:51:59 |-0500..O|
|000001c0| 6e 20 46 72 69 2c 20 31 | 35 20 4d 61 72 20 31 39 |n Fri, 1|5 Mar 19|
|000001d0| 39 36 2c 20 47 6f 72 64 | 6f 6e 20 42 75 72 64 69 |96, Gord|on Burdi|
|000001e0| 74 74 20 77 72 6f 74 65 | 3a 0a 0a 3e 20 3e 54 68 |tt wrote|:..> >Th|
|000001f0| 65 20 70 72 6f 62 6c 65 | 6d 20 69 73 20 77 68 65 |e proble|m is whe|
|00000200| 6e 20 74 68 65 20 62 75 | 66 66 65 72 20 69 73 20 |n the bu|ffer is |
|00000210| 6e 6f 74 20 6e 75 6c 6c | 2d 74 65 72 6d 69 6e 61 |not null|-termina|
|00000220| 74 65 64 2c 20 77 68 69 | 63 68 0a 3e 20 3e 68 61 |ted, whi|ch.> >ha|
|00000230| 70 70 65 6e 73 20 61 20 | 6c 6f 74 2e 20 20 54 68 |ppens a |lot. Th|
|00000240| 65 20 73 74 72 73 70 6e | 20 66 75 6e 63 74 69 6f |e strspn| functio|
|00000250| 6e 20 43 4f 55 4c 44 20 | 72 65 61 64 20 70 61 73 |n COULD |read pas|
|00000260| 74 20 74 68 65 20 65 6e | 64 0a 3e 20 3e 6f 66 20 |t the en|d.> >of |
|00000270| 74 68 65 20 62 75 66 66 | 65 72 2e 2e 2e 2e 20 70 |the buff|er.... p|
|00000280| 6f 74 65 6e 74 69 61 6c | 6c 79 20 57 41 59 20 70 |otential|ly WAY p|
|00000290| 61 73 74 20 69 74 2e 20 | 20 0a 3e 20 0a 3e 20 53 |ast it. | .> .> S|
|000002a0| 69 6e 63 65 20 79 6f 75 | 20 73 65 65 6d 20 74 6f |ince you| seem to|
|000002b0| 20 62 65 20 63 6f 6e 63 | 65 72 6e 65 64 20 6c 61 | be conc|erned la|
|000002c0| 72 67 65 6c 79 20 77 69 | 74 68 20 73 70 65 65 64 |rgely wi|th speed|
|000002d0| 2c 20 63 6f 6e 73 69 64 | 65 72 0a 3e 20 74 68 61 |, consid|er.> tha|
|000002e0| 74 20 67 6f 69 6e 67 20 | 57 41 59 20 70 61 73 74 |t going |WAY past|
|000002f0| 20 74 68 65 20 65 6e 64 | 20 6f 66 20 74 68 65 20 | the end| of the |
|00000300| 62 75 66 66 65 72 2c 20 | 70 65 72 68 61 70 73 20 |buffer, |perhaps |
|00000310| 6d 65 67 61 62 79 74 65 | 73 0a 3e 20 70 61 73 74 |megabyte|s.> past|
|00000320| 20 69 74 2c 20 63 61 6e | 20 62 65 20 2a 53 4c 4f | it, can| be *SLO|
|00000330| 57 2a 2e 20 20 45 73 70 | 65 63 69 61 6c 6c 79 20 |W*. Esp|ecially |
|00000340| 69 66 20 69 74 20 63 61 | 75 73 65 73 20 61 20 6c |if it ca|uses a l|
|00000350| 6f 74 0a 3e 20 6f 66 20 | 70 61 67 69 6e 67 2e 0a |ot.> of |paging..|
|00000360| 0a 56 65 72 79 20 76 61 | 6c 69 64 20 70 6f 69 6e |.Very va|lid poin|
|00000370| 74 2e 0a 0a 3e 20 0a 3e | 20 3e 50 6f 73 73 69 62 |t...> .>| >Possib|
|00000380| 6c 79 20 65 76 65 6e 20 | 69 6e 74 6f 0a 3e 20 3e |ly even |into.> >|
|00000390| 6d 65 6d 6f 72 79 20 6e | 6f 74 20 6f 77 6e 65 64 |memory n|ot owned|
|000003a0| 20 62 79 20 74 68 65 20 | 70 72 6f 67 72 61 6d 2e | by the |program.|
|000003b0| 20 20 0a 3e 20 0a 3e 20 | 53 65 67 6d 65 6e 74 61 | .> .> |Segmenta|
|000003c0| 74 69 6f 6e 20 66 61 75 | 6c 74 20 2d 20 63 6f 72 |tion fau|lt - cor|
|000003d0| 65 20 64 75 6d 70 65 64 | 2e 0a 3e 20 0a 0a 49 6e |e dumped|..> ..In|
|000003e0| 20 6d 79 20 74 65 73 74 | 69 6e 67 2c 20 49 20 75 | my test|ing, I u|
|000003f0| 73 65 64 20 72 65 6c 61 | 74 69 76 65 6c 79 20 6c |sed rela|tively l|
|00000400| 61 72 67 65 20 62 75 66 | 66 65 72 73 20 28 31 30 |arge buf|fers (10|
|00000410| 30 30 30 20 2d 20 32 30 | 30 30 30 20 63 68 61 72 |000 - 20|000 char|
|00000420| 61 63 74 65 72 73 29 3b | 20 0a 74 65 73 74 69 6e |acters);| .testin|
|00000430| 67 20 73 69 6e 63 65 20 | 6d 79 20 6d 65 73 73 61 |g since |my messa|
|00000440| 67 65 20 77 69 74 68 20 | 65 76 65 6e 20 6c 61 72 |ge with |even lar|
|00000450| 67 65 72 20 62 75 66 66 | 65 72 73 20 28 31 30 30 |ger buff|ers (100|
|00000460| 30 30 30 30 20 6f 72 20 | 6d 6f 72 65 29 20 0a 64 |0000 or |more) .d|
|00000470| 65 66 69 6e 69 74 65 6c | 79 20 63 61 75 73 65 64 |efinitel|y caused|
|00000480| 20 76 69 6f 6c 61 74 69 | 6f 6e 73 2e 20 20 49 20 | violati|ons. I |
|00000490| 6a 75 73 74 20 68 61 64 | 6e 27 74 20 74 65 73 74 |just had|n't test|
|000004a0| 65 64 20 6f 75 74 20 66 | 61 72 20 65 6e 6f 75 67 |ed out f|ar enoug|
|000004b0| 68 2e 0a 0a 3e 20 0a 3e | 20 3e 54 68 69 73 20 69 |h...> .>| >This i|
|000004c0| 73 20 77 68 65 72 65 20 | 49 20 67 65 74 20 63 6f |s where |I get co|
|000004d0| 6e 63 65 72 6e 65 64 2e | 0a 3e 20 3e 41 6e 79 6f |ncerned.|.> >Anyo|
|000004e0| 6e 65 20 6b 6e 6f 77 20 | 69 66 20 74 68 69 73 20 |ne know |if this |
|000004f0| 63 6f 75 6c 64 20 63 61 | 75 73 65 20 74 72 6f 75 |could ca|use trou|
|00000500| 62 6c 65 2c 20 67 65 6e | 65 72 61 6c 6c 79 2c 20 |ble, gen|erally, |
|00000510| 61 6e 64 20 69 66 0a 3e | 20 3e 69 74 20 63 6f 75 |and if.>| >it cou|
|00000520| 6c 64 20 63 61 75 73 65 | 20 74 72 6f 75 62 6c 65 |ld cause| trouble|
|00000530| 20 73 70 65 63 69 66 69 | 63 61 6c 6c 79 20 69 6e | specifi|cally in|
|00000540| 20 44 4f 53 2f 57 69 6e | 2f 55 6e 69 78 20 28 69 | DOS/Win|/Unix (i|
|00000550| 74 20 69 73 0a 3e 20 3e | 75 73 65 64 20 69 6e 20 |t is.> >|used in |
|00000560| 61 20 55 6e 69 78 20 61 | 70 70 20 6e 6f 77 29 2e |a Unix a|pp now).|
|00000570| 0a 3e 20 0a 3e 20 4f 66 | 20 63 6f 75 72 73 65 20 |.> .> Of| course |
|00000580| 69 74 20 63 61 6e 20 63 | 61 75 73 65 20 74 72 6f |it can c|ause tro|
|00000590| 75 62 6c 65 2e 20 20 0a | 0a 49 20 67 75 65 73 73 |uble. .|.I guess|
|000005a0| 20 6d 79 20 6d 69 6e 64 | 73 65 74 20 77 61 73 2c | my mind|set was,|
|000005b0| 20 49 27 6d 20 6e 6f 74 | 20 63 68 61 6e 67 69 6e | I'm not| changin|
|000005c0| 67 20 61 6e 79 74 68 69 | 6e 67 2c 20 6a 75 73 74 |g anythi|ng, just|
|000005d0| 20 72 65 61 64 69 6e 67 | 20 2d 20 62 75 74 20 61 | reading| - but a|
|000005e0| 73 20 0a 73 65 76 65 72 | 61 6c 20 70 65 6f 70 6c |s .sever|al peopl|
|000005f0| 65 20 68 61 76 65 20 70 | 6f 69 6e 74 65 64 20 6f |e have p|ointed o|
|00000600| 75 74 2c 20 61 6e 79 20 | 61 74 74 65 6d 70 74 20 |ut, any |attempt |
|00000610| 74 6f 20 64 6f 20 73 6f | 20 69 6e 20 6d 6f 72 65 |to do so| in more|
|00000620| 20 70 72 6f 74 65 63 74 | 65 64 20 0a 4f 53 73 20 | protect|ed .OSs |
|00000630| 28 6c 69 6b 65 20 57 69 | 6e 29 20 77 69 6c 6c 20 |(like Wi|n) will |
|00000640| 63 72 61 73 68 20 79 6f | 75 72 20 70 72 6f 67 72 |crash yo|ur progr|
|00000650| 61 6d 20 69 6e 20 63 61 | 73 65 20 69 74 20 69 73 |am in ca|se it is|
|00000660| 20 74 72 79 69 6e 67 20 | 74 6f 20 70 6f 6b 65 20 | trying |to poke |
|00000670| 0a 73 6f 6d 65 77 68 65 | 72 65 20 69 74 20 73 68 |.somewhe|re it sh|
|00000680| 6f 75 6c 64 20 6e 6f 74 | 20 2d 20 77 68 69 63 68 |ould not| - which|
|00000690| 20 6d 79 20 66 75 6e 63 | 74 69 6f 6e 20 77 6f 75 | my func|tion wou|
|000006a0| 6c 64 2e 0a 0a 3e 20 0a | 3e 20 4f 6e 65 20 70 6f |ld...> .|> One po|
|000006b0| 73 73 69 62 6c 65 20 77 | 6f 72 6b 61 72 6f 75 6e |ssible w|orkaroun|
|000006c0| 64 2c 20 69 66 20 79 6f | 75 20 63 61 6e 20 61 73 |d, if yo|u can as|
|000006d0| 73 75 6d 65 20 74 68 61 | 74 20 74 68 65 20 62 75 |sume tha|t the bu|
|000006e0| 66 66 65 72 73 20 61 72 | 65 0a 3e 20 77 72 69 74 |ffers ar|e.> writ|
|000006f0| 61 62 6c 65 2c 20 69 73 | 20 74 6f 20 74 65 72 6d |able, is| to term|
|00000700| 69 6e 61 74 65 20 74 68 | 65 20 62 75 66 66 65 72 |inate th|e buffer|
|00000710| 2c 20 63 68 65 63 6b 20 | 74 68 65 20 6c 61 73 74 |, check |the last|
|00000720| 20 63 68 61 72 61 63 74 | 65 72 0a 3e 20 79 6f 75 | charact|er.> you|
|00000730| 20 77 72 6f 74 65 20 6f | 76 65 72 2c 20 63 68 65 | wrote o|ver, che|
|00000740| 63 6b 20 74 68 65 20 62 | 75 66 66 65 72 2c 20 61 |ck the b|uffer, a|
|00000750| 6e 64 20 74 68 65 6e 20 | 70 75 74 20 74 68 65 20 |nd then |put the |
|00000760| 6c 61 73 74 20 63 68 61 | 72 61 63 74 65 72 20 62 |last cha|racter b|
|00000770| 61 63 6b 2e 0a 3e 20 0a | 0a 59 65 61 68 2c 20 77 |ack..> .|.Yeah, w|
|00000780| 65 27 6c 6c 20 6a 75 73 | 74 20 65 6e 64 20 75 70 |e'll jus|t end up|
|00000790| 20 64 6f 69 6e 67 20 61 | 20 62 79 74 65 2d 62 79 | doing a| byte-by|
|000007a0| 2d 62 79 74 65 20 63 6f | 6d 70 61 72 65 20 6f 66 |-byte co|mpare of|
|000007b0| 20 74 68 65 20 62 75 66 | 66 65 72 20 74 6f 20 74 | the buf|fer to t|
|000007c0| 68 65 20 0a 73 74 72 69 | 6e 67 2c 20 70 72 6f 62 |he .stri|ng, prob|
|000007d0| 61 62 6c 79 20 77 69 74 | 68 20 6d 65 6d 63 68 72 |ably wit|h memchr|
|000007e0| 20 2d 20 70 72 65 73 75 | 6d 61 62 6c 79 2c 20 69 | - presu|mably, i|
|000007f0| 74 20 69 73 20 70 72 65 | 74 74 79 20 77 65 6c 6c |t is pre|tty well|
|00000800| 20 6f 70 74 69 6d 69 7a | 65 64 20 0a 6a 75 73 74 | optimiz|ed .just|
|00000810| 20 61 73 20 73 74 72 73 | 70 6e 20 77 61 73 2e 20 | as strs|pn was. |
|00000820| 20 54 68 61 6e 6b 73 20 | 66 6f 72 20 74 68 65 20 | Thanks |for the |
|00000830| 69 6e 70 75 74 2e 0a 0a | 3e 20 09 09 09 09 09 47 |input...|> .....G|
|00000840| 6f 72 64 6f 6e 20 4c 2e | 20 42 75 72 64 69 74 74 |ordon L.| Burditt|
|00000850| 0a 3e 20 09 09 09 09 09 | 73 6e 65 61 6b 79 2e 6c |.> .....|sneaky.l|
|00000860| 65 72 63 74 72 2e 6f 72 | 67 21 67 6f 72 64 6f 6e |erctr.or|g!gordon|
|00000870| 0a 3e 20 0a 0a 0a 2b 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.> ...+=|========|
|00000880| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000890| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000008a0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000008b0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000008c0| 3d 3d 3d 2b 0a 7c 20 53 | 74 65 76 65 20 4d 6f 75 |===+.| S|teve Mou|
|000008d0| 6e 74 2c 20 53 6f 66 74 | 77 61 72 65 20 45 6e 67 |nt, Soft|ware Eng|
|000008e0| 69 6e 65 65 72 20 20 20 | 20 20 20 20 20 20 20 20 |ineer | |
|000008f0| 20 57 6f 72 6b 3a 20 73 | 6a 6a 6d 40 68 61 77 6b | Work: s|jjm@hawk|
|00000900| 65 79 65 2e 69 64 78 2e | 63 6f 6d 20 20 20 20 20 |eye.idx.|com |
|00000910| 20 20 7c 0a 7c 20 43 49 | 53 3a 20 37 33 37 32 30 | |.| CI|S: 73720|
|00000920| 2c 33 34 30 34 20 20 4d | 53 4e 3a 20 53 5f 4d 6f |,3404 M|SN: S_Mo|
|00000930| 75 6e 74 61 69 6e 20 20 | 20 20 20 20 20 20 20 20 |untain | |
|00000940| 48 6f 6d 65 3a 20 6d 6f | 75 6e 74 61 69 6e 40 73 |Home: mo|untain@s|
|00000950| 6f 76 65 72 2e 6e 65 74 | 20 20 20 20 20 20 20 20 |over.net| |
|00000960| 20 7c 0a 7c 20 41 4f 4c | 3a 20 4d 6f 75 6e 74 61 | |.| AOL|: Mounta|
|00000970| 69 6e 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |in | |
|00000980| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000990| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000009b0| 7c 0a 7c 20 57 57 57 3a | 20 68 74 74 70 3a 2f 2f ||.| WWW:| http://|
|000009c0| 77 77 77 2e 73 6f 76 65 | 72 2e 6e 65 74 2f 7e 6d |www.sove|r.net/~m|
|000009d0| 6f 75 6e 74 61 69 6e 2f | 20 20 20 20 20 20 22 46 |ountain/| "F|
|000009e0| 69 67 68 74 2c 20 57 69 | 6e 2c 20 50 72 65 76 61 |ight, Wi|n, Preva|
|000009f0| 69 6c 21 22 20 20 20 20 | 20 20 20 20 20 20 20 7c |il!" | ||
|00000a00| 0a 2b 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.+======|========|
|00000a10| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000a20| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000a30| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|00000a40| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 2b 0a |========|======+.|
|00000a50| 0a 0a | |.. | |
+--------+-------------------------+-------------------------+--------+--------+